import Ember from 'ember';
import RSVP from 'rsvp';
import config from 'game-front/config/environment';

export default Ember.Route.extend({
  actions: {
    record(){
      $("#frist-icon").attr("src", "assets/images/ranking/dt2.png");
      $("#content-one").css({"display": "none"});
      $("#content-two").css({"display": "block"});
    },
    records(){
      $("#frist-icon").attr("src", "assets/images/ranking/dt.png");
      $("#content-one").css({"display": "block"});
      $("#content-two").css({"display": "none"});
    }
  },
  model() {
    var userInfo = this.modelFor("application");
    return RSVP.hash({
      userInfo: userInfo,
      creditRecords:$.getJSON(config.apiBase + "creditRecords", {userId:userInfo.userId, page:0, size:20}),
      bills: $.getJSON(config.apiBase + "bills", {userId:userInfo.userId, page:0, size:20})
    });
}
});
